473,471 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

make area around anchor be clickable?

Test page:

http://www.key-horse.com/linkt.html

I have a td that's styled to look something like a button, and on that
button is anchor text. So far, I can't make the entire "surface" of the
button be a part of the anchor. That is, I would like to click on /any/
place on the td/button surface and take the link. As it is now, the
only clickable area is in the text itself.

Has anyone any ideas of how to make the whole surface of this thing be
sensitive to mouse clicks?

Thank you for any suggestions. I've tried a lot of things, but no joy.

-- KO Jim

Jul 24 '05 #1
9 13006
kojim wrote:

http://www.key-horse.com/linkt.html

So far, I can't make the entire "surface" of the
button be a part of the anchor.
I've tried a lot of things, but no joy.


Did you try searching google?
http://www.google.com/search?num=100...le&btnG=Search

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 24 '05 #2
kojim wrote:

Test page:

http://www.key-horse.com/linkt.html

I have a td that's styled to look something like a button, and on that
button is anchor text. So far, I can't make the entire "surface" of the
button be a part of the anchor. That is, I would like to click on /any/
place on the td/button surface and take the link. As it is now, the
only clickable area is in the text itself.

Has anyone any ideas of how to make the whole surface of this thing be
sensitive to mouse clicks?

Thank you for any suggestions. I've tried a lot of things, but no joy.


This required a combination of HTML and CSS1. See
<URL:http://www.rossde.com/test/table_cell.html>, its source HTML,
and my primary style-sheet at
<URL:http://www.rossde.com/genl_style.css>.

The entire green area in the second row, second column, is within
the anchor; because of my primary style-sheet, it turns yellow when
the cursor is over it. Making the width of the anchor equal the
width of cell was easy. You will have to manipulate the padding to
adjust the height.

Please post a reply here when you are through using my example so
that I can remove it. I'm near the limit allowed on my ISP's Web
server.

NOTE: I only tested this with Mozilla 1.7.7. I don't know how
this looks with IE or other browsers. However, the HTML and CSS
validated at W3C.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 24 '05 #3
kojim wrote:
Test page:

http://www.key-horse.com/linkt.html

I have a td that's styled to look something like a button, and on that
button is anchor text.


What is the table markup for? Are you aware that any element may be
styled, not just tables and divs, so it is not necessary to abuse them
for that purpose. All 13 lines of markup within the body of that test
page can be reduced to a single line:

<p><a href="/ccbill/index.htm">signup</a></p>

Then, in your style sheet, style it like this:

p { float: right; }
a {
border: 4px outset black;
background-color: #e0e0e0;
color: blue;
text-align: center;
padding: 1.5em;
font-weight: bold;
font-style: italic;
}

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 24 '05 #4
> All 13 lines of markup within the body of that test
page can be reduced to a single line:

<p><a href="/ccbill/index.htm">signu*p</a></p>

Then, in your style sheet, style it like this:

p { float: right; }
a { border: 4px outset black;
background-color: #e0e0e0;
color: blue;
text-align: center;
padding: 1.5em;
font-weight: bold;
font-style: italic; }


Yes, thank you, Lachlan. That is beautiful and elegant and pleasing and
it works 100% perfectly in FF1.0. But it doesn't work for me in IE6:

http://www.key-horse.com/linkt.html

I'm very much a novice in this business, so if you could suggest a way
to make it work in IE, I'd be grateful. Thanks again!

-- KOJim

Jul 24 '05 #5
The problem is that IE6 is not standards compliant and doesn't
recognize the 'box model' in CSS, so getting that scheme to work in IE
is probably not possible without some SERIOUS tweaking.

Jul 24 '05 #6
Grant Smith - eNVENT Technologies wrote:
The problem is that IE6 is not standards compliant and doesn't
recognize the 'box model' in CSS,


Yes it does. As long as you're triggering standards mode, IE6 uses the
correct box model. The incorrect box model was a bug with IE5/Win. I'm
not sure about IE6 in quirks mode, though.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 24 '05 #7
kojim wrote:
All 13 lines of markup within the body of that test
page can be reduced to a single line:

<p><a href="/ccbill/index.htm">signuÂ*p</a></p>

Then, in your style sheet, style it like this:
...

Yes, thank you, Lachlan. That is beautiful and elegant and pleasing and
it works 100% perfectly in FF1.0. But it doesn't work for me in IE6:

http://www.key-horse.com/linkt.html


Yikes! I'm not sure what you're trying to do with that test page, but
it's even messier than before. What's with the extraneous abuse of the
table elements, <object style=""> element and the <div> within the <a>
(and that's just in the small part that isn't commented out)?

Did you forget my previous point that stylesheets can apply to *any*
element, not just divs and tables. All the styles you have applied to
all those extraneous elements should be applied to either the <a>
element or it's parent (probably a <p> element).

Once you clean up the markup mess and make the page validate, try asking
in c.i.w.a.stylesheets for help to fix it in IE, if you can't find an
answer with a search engine first.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 24 '05 #8
Well IE didn't display my box correctly AT ALL, and I haven't changed any settings, so that means that by default, IE won't display it correctly.

Grant Smith
A+, Network+, MCP x 2

B.S.I.T. Degree Program
University of Phoenix Online
gk********@email.uophx.edu

Mobile: +1.765.315.9099

"Lachlan Hunt" <sp***********@gmail.com> wrote in message news:ok*******************@news-server.bigpond.net.au...
Grant Smith - eNVENT Technologies wrote:
The problem is that IE6 is not standards compliant and doesn't
recognize the 'box model' in CSS,


Yes it does. As long as you're triggering standards mode, IE6 uses the
correct box model. The incorrect box model was a bug with IE5/Win. I'm
not sure about IE6 in quirks mode, though.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 24 '05 #9
Lachlan Hunt wrote:
Yikes! I'm not sure what you're trying to do with that test page, but it's even messier than before. What's with the extraneous abuse of the table elements, <object style=""> element and the <div> within the <a> (and that's just in the small part that isn't commented out)?
Heh! Sorry to upset you -- was just experimenting, trying things out
:-) A better test page is up there now:

http://www.key-horse.com/linkt.html
Did you forget my previous point that stylesheets can apply to *any*
element, not just divs and tables.
Certainly not! I remembered it very well and immediately used your
suggestion, thank you.
All the styles you have applied to
all those extraneous elements should be applied to either the <a>
element or it's parent (probably a <p> element).
I applied all the styles within the <a> element. Because I want the
whole surface of the button to respond to a mouse click (and couldn't
do that with a background image in a table cell) I made the button an
<img> from a 1-pixel source. All of that markup, I believe, is
straightforward except that there's a lot of it in the html file that
should perhaps be moved to the css file.

The messy part now is the markup trying to get the text label of the
button y-centered in the button's <img>.
Once you clean up the markup mess and make the page validate,
The markup is cleaner and the page does validate. The <img> label is
still within a <div>; and that <div> is still within an <object>.
try asking
in c.i.w.a.stylesheets for help to fix it in IE, if you can't find an answer with a search engine first.


OK, Thanks. In fact, it seems to work in both FF and IE now so I won't
have to tweak anything for IE, it looks like. I don't know that it
works in all browsers, though.

-- KO Jim

Jul 24 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: JimC | last post by:
Think I asked this once before. My apologies for asking twice. In a certain PHP document at my site, I have a link to a Word version of the same document. If the user downloads it, I want to...
53
by: Kerberos | last post by:
I followed Dan Cederholm's image replacement tutorial, to replace a header tag by a logo. The h1 is clickable if no CSS is applied but it I replace it by the logo, the area isn't clickable anymore...
3
by: Amir | last post by:
Hi every one I had a question I have a DataGrid where I display Employee name and Their Schedule the Grid has 8 Columns ...somewhere in my web Application the admin should have an option of...
1
by: RJN | last post by:
Hi I have a datagrid which has about 6 template columns. Currently the first template column has a link button and rest all are label controls. Now I can click on the first column to fire an...
7
by: aviad | last post by:
I am writing a Form application I need it to fit both resolution of 1600*1200 and 800*600 (and any other resolution that might jump in) the application is meant for regular PCs another question...
3
by: Irocivan | last post by:
Hello, I download a nice collapse menu for free distribution from the internet. It works very well except that none of the parents nodes are clickable (i.e. when clicking on the parent node, the...
0
by: sandysam | last post by:
Hi, I am new to ASP. I would like to get the database data on to my HTML form as table and make every row of that table clickable. I also would like to show the same data in a drop down box. When I...
16
by: ekokaos | last post by:
I have an image of an open book as the main menu on my website. Each word written in the book links to a related page. I would like to develop it further and have it so that the person can click a...
1
nathj
by: nathj | last post by:
Hi, I'm working on my own site - a long overdue project and I have come up with a design I'm really happy with. However, the design has a torn edge look at the bottom of the header with three...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.